3.1.14 \(\int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=76 \[ -\frac {1}{6} \tanh ^{-1}\left (\frac {x}{2}\right ) (d+4 f+16 h)+\frac {1}{3} \tanh ^{-1}(x) (d+f+h)-\frac {1}{6} \log \left (1-x^2\right ) (e+g+i)+\frac {1}{6} \log \left (4-x^2\right ) (e+4 g+16 i)+h x+\frac {i x^2}{2} \]

________________________________________________________________________________________

Rubi [A]  time = 0.19, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {1673, 1676, 1166, 207, 1663, 1657, 632, 31} \begin {gather*} -\frac {1}{6} \tanh ^{-1}\left (\frac {x}{2}\right ) (d+4 f+16 h)+\frac {1}{3} \tanh ^{-1}(x) (d+f+h)-\frac {1}{6} \log \left (1-x^2\right ) (e+g+i)+\frac {1}{6} \log \left (4-x^2\right ) (e+4 g+16 i)+h x+\frac {i x^2}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(4 - 5*x^2 + x^4),x]

[Out]

h*x + (i*x^2)/2 - ((d + 4*f + 16*h)*ArcTanh[x/2])/6 + ((d + f + h)*ArcTanh[x])/3 - ((e + g + i)*Log[1 - x^2])/
6 + ((e + 4*g + 16*i)*Log[4 - x^2])/6

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 632

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[
(c*d - e*(b/2 - q/2))/q, Int[1/(b/2 - q/2 + c*x), x], x] - Dist[(c*d - e*(b/2 + q/2))/q, Int[1/(b/2 + q/2 + c*
x), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] && NiceSqrtQ[b^2 - 4*a*
c]

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 1663

Int[(Pq_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Dist[1/2, Subst[Int[x^((m - 1)/2)
*SubstFor[x^2, Pq, x]*(a + b*x + c*x^2)^p, x], x, x^2], x] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x^2] && Inte
gerQ[(m - 1)/2]

Rule 1673

Int[(Pq_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Module[{q = Expon[Pq, x], k}, Int[Sum[Coeff[
Pq, x, 2*k]*x^(2*k), {k, 0, q/2}]*(a + b*x^2 + c*x^4)^p, x] + Int[x*Sum[Coeff[Pq, x, 2*k + 1]*x^(2*k), {k, 0,
(q - 1)/2}]*(a + b*x^2 + c*x^4)^p, x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] &&  !PolyQ[Pq, x^2]

Rule 1676

Int[(Pq_)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> Int[ExpandIntegrand[Pq/(a + b*x^2 + c*x^4), x], x
] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x^2] && Expon[Pq, x^2] > 1

Rubi steps

\begin {align*} \int \frac {d+e x+f x^2+g x^3+h x^4+14 x^5}{4-5 x^2+x^4} \, dx &=\int \frac {x \left (e+g x^2+14 x^4\right )}{4-5 x^2+x^4} \, dx+\int \frac {d+f x^2+h x^4}{4-5 x^2+x^4} \, dx\\ &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {e+g x+14 x^2}{4-5 x+x^2} \, dx,x,x^2\right )+\int \left (h+\frac {d-4 h+(f+5 h) x^2}{4-5 x^2+x^4}\right ) \, dx\\ &=h x+\frac {1}{2} \operatorname {Subst}\left (\int \left (14-\frac {56-e-(70+g) x}{4-5 x+x^2}\right ) \, dx,x,x^2\right )+\int \frac {d-4 h+(f+5 h) x^2}{4-5 x^2+x^4} \, dx\\ &=h x+7 x^2-\frac {1}{2} \operatorname {Subst}\left (\int \frac {56-e-(70+g) x}{4-5 x+x^2} \, dx,x,x^2\right )-\frac {1}{3} (d+f+h) \int \frac {1}{-1+x^2} \, dx+\frac {1}{3} (d+4 f+16 h) \int \frac {1}{-4+x^2} \, dx\\ &=h x+7 x^2-\frac {1}{6} (d+4 f+16 h) \tanh ^{-1}\left (\frac {x}{2}\right )+\frac {1}{3} (d+f+h) \tanh ^{-1}(x)-\frac {1}{6} (-224-e-4 g) \operatorname {Subst}\left (\int \frac {1}{-4+x} \, dx,x,x^2\right )-\frac {1}{6} (14+e+g) \operatorname {Subst}\left (\int \frac {1}{-1+x} \, dx,x,x^2\right )\\ &=h x+7 x^2-\frac {1}{6} (d+4 f+16 h) \tanh ^{-1}\left (\frac {x}{2}\right )+\frac {1}{3} (d+f+h) \tanh ^{-1}(x)-\frac {1}{6} (14+e+g) \log \left (1-x^2\right )+\frac {1}{6} (224+e+4 g) \log \left (4-x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 98, normalized size = 1.29 \begin {gather*} \frac {1}{12} \left (-2 \log (1-x) (d+e+f+g+h+i)+\log (2-x) (d+2 e+4 (f+2 g+4 h+8 i))+2 \log (x+1) (d-e+f-g+h-i)-\log (x+2) (d-2 (e-2 f+4 g-8 h+16 i))+12 h x+6 i x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(4 - 5*x^2 + x^4),x]

[Out]

(12*h*x + 6*i*x^2 - 2*(d + e + f + g + h + i)*Log[1 - x] + (d + 2*e + 4*(f + 2*g + 4*h + 8*i))*Log[2 - x] + 2*
(d - e + f - g + h - i)*Log[1 + x] - (d - 2*(e - 2*f + 4*g - 8*h + 16*i))*Log[2 + x])/12

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x+f x^2+g x^3+h x^4+i x^5}{4-5 x^2+x^4} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(4 - 5*x^2 + x^4),x]

[Out]

IntegrateAlgebraic[(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(4 - 5*x^2 + x^4), x]

________________________________________________________________________________________

fricas [A]  time = 20.10, size = 88, normalized size = 1.16 \begin {gather*} \frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/2*i*x^2 + h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2) + 1/6*(d - e + f - g + h - i)*log(x + 1)
 - 1/6*(d + e + f + g + h + i)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)

________________________________________________________________________________________

giac [A]  time = 0.26, size = 96, normalized size = 1.26 \begin {gather*} \frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d + 4 \, f - 8 \, g + 16 \, h - 32 \, i - 2 \, e\right )} \log \left ({\left | x + 2 \right |}\right ) + \frac {1}{6} \, {\left (d + f - g + h - i - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{6} \, {\left (d + f + g + h + i + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac {1}{12} \, {\left (d + 4 \, f + 8 \, g + 16 \, h + 32 \, i + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/2*i*x^2 + h*x - 1/12*(d + 4*f - 8*g + 16*h - 32*i - 2*e)*log(abs(x + 2)) + 1/6*(d + f - g + h - i - e)*log(a
bs(x + 1)) - 1/6*(d + f + g + h + i + e)*log(abs(x - 1)) + 1/12*(d + 4*f + 8*g + 16*h + 32*i + 2*e)*log(abs(x
- 2))

________________________________________________________________________________________

maple [B]  time = 0.01, size = 179, normalized size = 2.36 \begin {gather*} \frac {i \,x^{2}}{2}-\frac {d \ln \left (x +2\right )}{12}+\frac {d \ln \left (x -2\right )}{12}-\frac {d \ln \left (x -1\right )}{6}+\frac {d \ln \left (x +1\right )}{6}+\frac {e \ln \left (x +2\right )}{6}+\frac {e \ln \left (x -2\right )}{6}-\frac {e \ln \left (x -1\right )}{6}-\frac {e \ln \left (x +1\right )}{6}-\frac {f \ln \left (x +2\right )}{3}+\frac {f \ln \left (x -2\right )}{3}-\frac {f \ln \left (x -1\right )}{6}+\frac {f \ln \left (x +1\right )}{6}+\frac {2 g \ln \left (x +2\right )}{3}+\frac {2 g \ln \left (x -2\right )}{3}-\frac {g \ln \left (x -1\right )}{6}-\frac {g \ln \left (x +1\right )}{6}+h x -\frac {4 h \ln \left (x +2\right )}{3}+\frac {4 h \ln \left (x -2\right )}{3}-\frac {h \ln \left (x -1\right )}{6}+\frac {h \ln \left (x +1\right )}{6}+\frac {8 i \ln \left (x +2\right )}{3}+\frac {8 i \ln \left (x -2\right )}{3}-\frac {i \ln \left (x -1\right )}{6}-\frac {i \ln \left (x +1\right )}{6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

8/3*ln(x+2)*i-1/6*ln(x-1)*i-1/6*ln(x+1)*i+8/3*ln(x-2)*i-4/3*h*ln(x+2)-1/6*h*ln(x-1)+1/6*h*ln(x+1)+4/3*h*ln(x-2
)-1/6*g*ln(x-1)+2/3*g*ln(x+2)+2/3*g*ln(x-2)-1/6*g*ln(x+1)-1/12*d*ln(x+2)+1/6*e*ln(x+2)-1/6*e*ln(x-1)-1/6*d*ln(
x-1)-1/6*e*ln(x+1)+1/6*d*ln(x+1)+1/12*d*ln(x-2)+1/6*e*ln(x-2)+1/3*f*ln(x-2)+1/6*f*ln(x+1)-1/6*f*ln(x-1)-1/3*f*
ln(x+2)+1/2*i*x^2+h*x

________________________________________________________________________________________

maxima [A]  time = 1.25, size = 88, normalized size = 1.16 \begin {gather*} \frac {1}{2} \, i x^{2} + h x - \frac {1}{12} \, {\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h - 32 \, i\right )} \log \left (x + 2\right ) + \frac {1}{6} \, {\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac {1}{6} \, {\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac {1}{12} \, {\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/2*i*x^2 + h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h - 32*i)*log(x + 2) + 1/6*(d - e + f - g + h - i)*log(x + 1)
 - 1/6*(d + e + f + g + h + i)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)

________________________________________________________________________________________

mupad [B]  time = 1.19, size = 108, normalized size = 1.42 \begin {gather*} h\,x+\frac {i\,x^2}{2}-\ln \left (x-1\right )\,\left (\frac {d}{6}+\frac {e}{6}+\frac {f}{6}+\frac {g}{6}+\frac {h}{6}+\frac {i}{6}\right )+\ln \left (x+1\right )\,\left (\frac {d}{6}-\frac {e}{6}+\frac {f}{6}-\frac {g}{6}+\frac {h}{6}-\frac {i}{6}\right )+\ln \left (x-2\right )\,\left (\frac {d}{12}+\frac {e}{6}+\frac {f}{3}+\frac {2\,g}{3}+\frac {4\,h}{3}+\frac {8\,i}{3}\right )-\ln \left (x+2\right )\,\left (\frac {d}{12}-\frac {e}{6}+\frac {f}{3}-\frac {2\,g}{3}+\frac {4\,h}{3}-\frac {8\,i}{3}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5)/(x^4 - 5*x^2 + 4),x)

[Out]

h*x + (i*x^2)/2 - log(x - 1)*(d/6 + e/6 + f/6 + g/6 + h/6 + i/6) + log(x + 1)*(d/6 - e/6 + f/6 - g/6 + h/6 - i
/6) + log(x - 2)*(d/12 + e/6 + f/3 + (2*g)/3 + (4*h)/3 + (8*i)/3) - log(x + 2)*(d/12 - e/6 + f/3 - (2*g)/3 + (
4*h)/3 - (8*i)/3)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

Timed out

________________________________________________________________________________________